# -*- coding: utf-8 -*-



## ------------------------------------------------------------
## Copyright 2010 Pierre-Antoine Delsart
## 
## This file is part of LeVin.
## 
## LeVin is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
## 
## LeVin is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
## 
## You should have received a copy of the GNU General Public License
## along with LeVin.  If not, see <http://www.gnu.org/licenses/>.
## ---------------------------------------------------------------

from PythonQt import QtCore, QtGui
from string import Template

Style=Template("""
QWidget {
    background-color: transparent;
    border-color: transparent;
}
QMenu {
   background-color: white;
}
QTabWidget::pane {
    background-color: rgba(255,255,255,200) ; 
    border-color: transparent;
}
QToolBar {
    background-color: rgba(255,255,255,200) ; 
    border-color: rgb(255,255,255);
}
QHeaderView::section {
    background-color : white;
    color : blue ;
    border:       0px solid #6c6c6c;
}
QTreeView::item:selected {
    background-color:  transparent;
    color : black ;
    font-weight : bold;
    border: 1px solid #567dbc;
    border-left: 0px solid #567dbc;
    border-right: 0px solid #567dbc;
}
QTreeView {
    background-color: rgba(255,255,255,200) ;
   /*background-color: rgb(255,255,0) ; */
   font: italic 14pt \"URW Chancery L\";
   border : 0px solid #567dbc;
}
QTreeView::branch {
   image : none;
}
QMainWindow {
    background-image: url(${ICONDIR}frenchwinebottle.png);
} 
QLabel#testT {
  font: italic 22pt \"Kerkis\";
  color : rgb(0,0,0) ;
  background-image: url(cbanner.png);  
}

QLabel#Desc_appellation {
  font: normal 22pt \"Kerkis\";
  color : rgb(0,0,0) ;
}

QLabel#Desc_cru_name {
  font: bold 24pt \"Kerkis\";
  color : rgb(0,0,0) ;
  /* text-align : center; not supported for QLabel ! */
  /*padding : 1em; WARNING : this seems to cause bugs*/ 
}

QLabel#Desc_millesime {
  font: italic 18pt \"URW Chancery L\";
  color : rgb(0,0,0) ;
/*  padding : 1em;*/
}
QLabel#Desc_meanrate {
   image-position: center;
}
QTabBar::tab {
  background-color : white;
  border: 2px solid #9B9B9B;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  padding: 2px;
}
QTabBar::tab:selected {
     border-color: #800000;
     border-bottom-color: white; /* same as pane color */
 }
 QTabBar::tab:!selected {
     margin-top: 2px; /* make non-selected tabs look smaller */
 }
QFrame#wineNameBox {
  border : 1px solid black;
  border-radius : 3ex;
}
QDialog {
    background-color: rgb(255,255,255) ;
}
QComboBox {
    selection-color : blue ;
}
QWidget#ComboBoxSelector {
  margin : 1px;
  border : 1px solid #800000;
  border-radius : 2ex;
}

QScrollBar::handle {
  background: white;
  border: 2px solid #800000;
  border-radius : 5px;
}

""")

def alignLabels(ui):
    pass
def treeWidgetStyles(ui):
    ui.resetRateTextColor()

